-
Notifications
You must be signed in to change notification settings - Fork 509
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(syntax-highlight): add additional languages #6831
Conversation
This pull request has merge conflicts that must be resolved before it can be merged. |
The pointers from py > python are good. IMO whatever github uses we should mirror. So do we actually have cases for all these types or are they speculative? I.e. ini files don't really have a particular format do they? When is "ignore" used? diff would be great in some cases but is it a standardized format? I can imagine using this to show when you make changes in a file. As @wbamberg suggests here https://github.com/orgs/mdn/discussions/170#discussioncomment-3352639 we need to make sure that the supported set is documented. Who can review/merge this nowdays? |
I'd be happy to add the alias back in! I removed it because both
A few of these are speculative (such as SQL, URI, SCSS and Less). I basically skimmed through the Prism supported list to find web-related and Git-related languages, and added them in.
They do, actually! Though this one's a speculative add, so I'm happy to take it out!
Ignore includes
It is a standard format, yes! |
If we don't need to map it ourselves then it doesn't need to be added back in. But the docs need to make clear what is supported.
The thing that kicked this off was nginx and apache, and I'd been hoping for "pug". My original thinking was add everything, but since Will has spoken against this, we really need to agree the policy before we put this in. I'll comment the set on the issue and lets see if we can get broad agreement. |
FYI, |
@queengooborg So I think we have settled about what languages can be added, and under what conditions: https://github.com/orgs/mdn/discussions/170#discussioncomment-3403112 Do these rules make sense for you? If so,
|
Co-authored-by: Claas Augner <[email protected]>
Co-authored-by: Hamish Willee <[email protected]>
Co-authored-by: Hamish Willee <[email protected]>
@queengooborg Ready for me to merge? |
Yep, go for it! If we want to add or remove any syntax languages, we can do so down the line. 👍 |
Thanks very much!!!! |
That's awesome, so which one of you is updating https://developer.mozilla.org/en-US/docs/MDN/Writing_guidelines/Howto/Markdown_in_MDN#example_code_blocks in line with https://github.com/orgs/mdn/discussions/170#discussioncomment-3403112 ? I already added pug and yaml in mdn/content#19806, and wasm was already in the list. |
This PR adds a number of additional languages for syntax highlighting. This will allow our React tutorials to be formatted properly (since there are some fundamental differences between it and JavaScript that will cause highlighting errors). Since syntax highlighting is performed at build time, adding more languages to syntax highlighting will not cause any additional loading times or load additional resources on the reader's end.
Additionally, this points both
sh
andshell
tobash
, andpy
topython
. A comment is also added to clarify which languages are already loaded to reduce confusion if this function is used as a reference for what syntax languages are available.